<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>纽斯达 NewStar | 特约商户</title>
<base href="<?=base_url()?>"  />
<link rel="stylesheet" href="css/base.css" />
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/business.css" />
<link rel="stylesheet" href="css/dialog.css" />	
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/placeholder.js"></script>
<script type="text/javascript" src="js/nav.js"></script>
<script type="text/javascript" src="js/dialog.js"></script>
<script type="text/javascript">
$(function(){		
	$('#dialog').dialog({
		autoOpen: false,
		modal: true,
		width: 500,
		height: 500
	});
});

function map(str) {
	$('#dialog img').attr("src","http://api.go2map.com/engine/api/static/image+{'points':'"+str+"','width':450,'height':450,'zoom':15,'center':'"+str+"','city':'上海'}.png");
	$('#dialog').dialog('open');
}
</script>
</head>
<body>
<div id="top-nav">
  <div class="container fn-clear">
    <div class="left text-darkgrey">
      <?php if($uid):?>
      <p>欢迎来到纽斯达！ 您好，<span class="text-yellow"><?=$name?></span>！<a href="home/logout" class="a-yellow">注销登录</a></p>
      <?php else:?>
      <p>欢迎来到纽斯达！ 请<a href="user/login" class="a-yellow">登录</a> <a href="user/register" class="a-yellow">免费注册</a></p>
      <?php endif;?>
    </div>
    <div class="right">
      <p><a href="user" class="a-yellow">会员中心</a>　<a href="help" class="a-yellow">帮助中心</a></p>
    </div>
  </div>
</div>
<div id="top" class="fn-clear">
  <div id="logo">
    <h1><a href="home" title="纽斯达 NewStar"><img src="images/logo.jpg" alt="纽斯达 NewStar" /></a></h1>
  </div>
  <div id="main-search">
    <form action="business/businessList" method="post">
      <input id="search" type="text" name="search" class="input" placeholder="搜索特约商户、商户地址..." />
      <input type="submit" value="搜索" class="button" />
    </form>
  </div>
</div>
<div id="nav" class="fn-clear">
  <ul>
    <li class="nav-item"><a href="home">首页</a></li>
    <li class="nav-item"><a href="news">最新动态</a>
      <ul>
        <li><a href="news/newsList">纽斯达新闻</a></li>
        <li><a href="news/activityList">商户活动</a></li>
        <li><a href="news/cardPostList">卡片公告</a></li>
      </ul>
    </li>
    <li class="nav-item"><a href="about/content/<?=$cardAboutList[0]['id']?>">纽斯达卡</a>
      <ul>
      	<?foreach ($cardAboutList as $row):?>
        <li><a href="about/content/<?=$row['id']?>"><?=$row['name']?></a></li>
        <?endforeach;?>
      </ul>
    </li>
    <li class="nav-item"><a href="business">特约商户</a></li>
    <li class="nav-item"><a href="user">会员中心</a></li>
    <li class="nav-item"><a href="help">帮助中心</a>
      <ul>
        <li><a href="card/balance">卡余额查询</a></li>
        <li><a href="help">常见问题</a></li>
        <li><a href="help/message">用户留言</a></li>
      </ul>
    </li>
    <li class="nav-item"><a href="about/content/<?=$aboutList[0]['id']?>">关于我们</a>
      <ul>
        <?foreach ($aboutList as $row):?>
        <li><a href="about/content/<?=$row['id']?>"><?=$row['name']?></a></li>
        <?endforeach;?>
      </ul>
    </li>
  </ul>
  <div id="check"><a href="check">特约商户网上对账</a></div>
</div>
<div id="main" class="fn-clear">
  <div id="bread-nav" class="fn-clear">
    <ul>
      <li><a href="home">首页</a></li>
      <li><a href="business">特约商户</a></li>
      <?php if($tClass1):?><li><a href="business/businessList/<?=$class1?>/0/<?=$region?>/<?=$area?>"><?=$tClass1?></a></li><?php endif; ?>
      <?php if($tClass2):?><li><a href="business/businessList/<?=$class1?>/<?=$class2?>/<?=$region?>/<?=$area?>"><?=$tClass2?></a></li><?php endif; ?>
      <?php if($tRegion):?><li><a href="business/businessList/<?=$class1?>/<?=$class2?>/<?=$region?>/0"><?=$tRegion?></a></li><?php endif; ?>
	  <?php if($tArea):?><li><a href="business/businessList/<?=$class1?>/<?=$class2?>/<?=$region?>/<?=$area?>"><?=$tArea?></a></li><?php endif; ?>
	  <?php if($group):?><li><a href="business/businessList/<?=$class1?>/<?=$class2?>/<?=$region?>/<?=$area?>/<?=$group?>"><?=$group?></a></li><?php endif; ?>
	  <?php if($search):?><li><a><?=$search?></a></li><?php endif; ?>
      <li>相关结果<span class="text-yellow"><?=$num?></span>条</li>
    </ul>
  </div>
  <div id="business" class="text-darkgrey fn-clear">
    <div class="left">
      <h2>按分类筛选</h2>
      <div id="class">
        <ul>
          <?php if($class1>0):?>
          <li class="close"><a href="<?="business/businessList/0".$url.'/0/'.$region.'/'.$area.'/'.urlencode ( $group )?>">查看所有分类</a></li>
          <?foreach ($class1List as $row):?>
          <li class="open"><a href="<?="business/businessList/".$row['id'].$url.'/0/'.$region.'/'.$area.'/'.urlencode ( $group )?>"><?=$row['name']?></a>(<?=$row['num']?>)
            <ul>
              <?foreach ($class2List as $row):?>
              <li><a href="<?="business/businessList/".$class1.$url.'/'.$row['id'].'/'.$region.'/'.$area.'/'.urlencode ( $group )?>"><?=$row['name']?></a>(<?=$row['num']?>)</li>
              <?endforeach;?>
            </ul>
          </li>
          <?endforeach;?>
          <?else:?>
          <?foreach ($class1List as $row):?>
		  <li class="close"><a href="<?="business/businessList/".$row['id'].$url.'/0/'.$region.'/'.$area.'/'.urlencode ( $group )?>"><?=$row['name']?></a>(<?=$row['num']?>)</li>
		  <?endforeach;?>
          <?php endif;?>
        </ul>
      </div>
      <h2>按地区筛选</h2>
      <div id="position">
        <ul>
		  <?php if($region>0):?>
		  <li class="close"><a href="<?="business/businessList/".$class1.$url.'/'.$class2.'/0/0'.'/'.urlencode ( $group )?>">查看所有地区</a></li>
		  <?foreach ($regionList as $row):?>
          <li class="open"><a href="<?="business/businessList/".$class1.$url.'/'.$class2.'/'.$row['id'].'/0'.'/'.urlencode ( $group )?>"><?=$row['name']?></a>(<?=$row['num']?>)
            <ul>
              <?foreach ($areaList as $row):?>
              <li><a href="<?="business/businessList/".$class1.$url.'/'.$class2.'/'.$region.'/'.$row['id'].'/'.urlencode ( $group )?>"><?=$row['name']?></a>(<?=$row['num']?>)</li>
              <?endforeach;?>
            </ul>
          </li>
          <?endforeach;?>
          <?else:?>
          <?foreach ($regionList as $row):?>
          <li class="close"><a href="<?="business/businessList/".$class1.$url.'/'.$class2.'/'.$row['id'].'/0'.'/'.urlencode ( $group )?>"><?=$row['name']?></a>(<?=$row['num']?>)</li>
          <?endforeach;?>
          <?php endif;?>
        </ul>
      </div>
    </div>
    <div class="right">
      <div id="business-list" class="fn-clear">
          <?php if ($num>0):?>
          <ul>
		  <?php foreach ($businessList as $row):?>
			<li class="fn-clear">
			<div class="image"><img src="<?php if($row['logoImage']!=' ') echo $row['logoImage']; else echo 'images/no-logo.jpg';?>" /></div>
			 <?php if($group):?>
			 <div class="content">
              <p class="title">
              <?=$row['name']?><?php if($row['state']=='U'):?>（即将开通）<?php endif;?>
              <?php if($row['groupName']):?>
				<span class="branch">（分店）</span>
			  <?php endif;?>
              </p>
              <p class="info"><span class="address">地址：<?=$row['address']?></span>　<span class="phone">电话：<?=$row['phone']?></span></p>
              <p class="others">
              <span class="recycle">
              <?php if($row['recycle']=='T'):?>
					可回收卡
				<?php else:?>
					不可回收卡
				<?php endif;?>
		      </span>
		      <span class="text-red detail"><?=$row['details']?></span>
		      <span class="map"><a href="javascript:;" onclick="map('<?=$row['address']?>')">（查看商户位置地图）</a></span></p>
            </div>
            <?php else:?>
            <div class="content">
            	<p class="title">
              <?=$row['groupName']?><?php if($row['state']=='U'):?>（即将开通）<?php endif;?>
              	<span class="branch">（<?=$row['num']?>家分店）</span>
				<span class="branch"><a href="
				<?php $tmp = preg_replace ( "/[^ " . chr ( 0x80 ) . "-" . chr ( 0xff ) . "\\w]+/ ", ' ',$row['groupName']);
					$tmp = urlencode ( $tmp );
					echo 'business/businessList/'.$class1.$url.'/'.$class2.'/'.$region.'/'.$area.'/'.strtr ($tmp, array ('+' => "%20"));
				?>" class="a-yellow">查看<?=$row['groupName']?>分店</a></span>
			
              </p>
               <p class="others">
              <span class="recycle">
              <?php if($row['recycle']=='T'):?>
					可回收卡
				<?php else:?>
					不可回收卡
				<?php endif;?>
		      </span>
		      <span class="status"></span></p>
            </div>
            <?php endif;?>
            </li>
		  <?php endforeach;?>
		  </ul>
      </div>
      <div id="page-nav">
        <?php echo $this->pagination->create_links();?>
      </div>
	  <?php else:?>
	  <div id="business-list">
	  <ul>
	  <li><p class="title">没有商户！</p></li>
	  </ul>
	  </div>
	  <?php endif;?>
    </div>
  </div>
</div>
<div id="bottom">
  <div class="fn-clear">
  <div id="bottom-nav">
    <ul>
      <li><img src="images/about-card-title.jpg" alt="关于卡片" />
        <ul>
          <li><a href="about/content/1">卡片介绍</a></li>
          <li><a href="about/content/3">持卡人须知</a></li>
          <li><a href="about/content/5">注意事项</a></li>
        </ul>
      </li>
      <li><img src="images/cooperation-title.jpg" alt="联系合作" />
        <ul>
          <li><a href="message/business">特约商户加盟</a></li>
        </ul>
      </li>
      <li><img src="images/help-title.jpg" alt="帮助中心" />
        <ul>
          <li><a href="card/balance">卡余额查询</a></li>
          <li><a href="help">常见问题</a></li>
          <li><a href="help/message">用户留言</a></li>
        </ul>
      </li>
      <li><img src="images/contact-title.jpg" alt="联系我们" />
        <ul>
          <li><a href="mailto:nsdkj@nsdkj.com.cn">联系邮箱</a></li>
        </ul>
      </li>
    </ul>
  </div>
  <div id="contact-info">
    <p>热线电话：021-63831111　联系地址：上海市伊犁南路111号钱江商务广场1601室A座</p>
  </div>
  <link rel="stylesheet" href="css/dialog.css" />	
  <script type="text/javascript" src="js/dialog.js"></script>
  <script type="text/javascript">
  $(function(){
  	  // Dialog			
  	  $('#nsdmap').dialog({
  		  autoOpen: false,
		  modal: true,
		  width: 500,
		  height: 500
	  });
	  // Dialog Link
	  $('#contact-info').click(function(){
		  $('#nsdmap').dialog('open');
		  return false;
	  });
  });
  </script>
  <div id="nsdmap" title="纽斯达位置地图">
  <p style="text-align:center;"><img src="http://api.go2map.com/engine/api/static/image+{'points':'上海市伊犁南路111号钱江商务广场1601室A座','width':450,'height':450,'zoom':15,'center':'上海市伊犁南路111号钱江商务广场1601室A座','city':'上海'}.png" /></p>
  </div>
  </div>
  <div id="copyright">
    <p>©2012 上海纽斯达科技有限公司　ICP备案号：沪ICP备10026991号　支付业务许可证编号：Z200973100016</p>
  </div>
</div>
<div id="dialog" title="商户地图">
	<p style="text-align:center;"><img /></p>
</div>
</body>
</html>